package berlinatyourfingertips.ua;

import java.util.Timer;
import java.util.TimerTask;

/**
 * Reporting to an UAListener
 * 
 * @author Denny Koch
 *
 */
public abstract class UAUpdating extends TimerTask {

	protected UAListener listener;
	protected Timer timer = new Timer();
	protected int updateInterval = 6000;
	
	public UAUpdating(UAListener listener, int updateInterval) {
		this.listener	=	listener;
	}
	
	public void start() {
		timer.scheduleAtFixedRate(this, 0, updateInterval);
	}

	public void stop() {
		timer.cancel();
	}

}
